{% extends base %}

{% block body_left %}
{% include system/component/db_nav.html %}

<script src="{{_server_home}}/_static/js/admin.js"></script>

{% init kv_table_name = None %}

<div class="card">

    <table class="table">
        <tr>
            <th style="width:20%">ID</th>
            <th style="width:60%">详情</th>
            <th style="width:20%">操作</th>
        </tr>
        {% for row in db_rows %}
        <tr class="hover-tr">
            <td>{{row.get(pk_name)}}</td>
            <td>{{row}}</td>
            <td>
                {% if kv_table_name != None %}
                    <a data-url="/system/sqldb_detail?method=get_kv_detail&key={{kv_table_name}}:{{row.get(pk_name)}}" 
                        onclick="xnote.admin.viewMainRecord(this)">查看主数据</a>
                {% end %}
            </td>
        </tr>
        {% end %}
    </table>
</div>

<div class="card">
    {% include common/pagination.html %}
</div>

{% end %}

{% block body_right %}
    {% include system/component/admin_nav.html %}
{% end %}